# 获取 CPU 核心数
if(NOT NPROC)
    set(NPROC 8)
    if(CMAKE_HOST_UNIX AND NOT WIN32)
        execute_process(
            COMMAND nproc
            OUTPUT_VARIABLE NPROC
            OUTPUT_STRIP_TRAILING_WHITESPACE
        )
    endif()
endif()
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
get_filename_component(__DIR "${_DIR}" PATH)
include(ExternalProject)
# 添加模块路径
list(APPEND CMAKE_MODULE_PATH ${__DIR})
# 配置工程
include(config/config_project)
# 变量定义 导入
include(config/with)
# 安装工具模块
include(utils/utils_install_linux)
# 检查安装文件是否存在
include(utils/exists_install_files)
message(NOTICE "开始构建 模块")
# mp3lame 模块
if(WITH_MP3LAME)
    include(module/mp3lame_module)
endif()

# speex 模块
if(WITH_SPEEX)
    include(module/speex_module)
endif()

# fdk-aac 模块
if(WITH_FDK_AAC)
    include(module/fdk_aac_module)
endif()

# x264 模块
if(WITH_X264)
    include(module/x264_module)
endif()

# x265 模块
if(WITH_X265)
    include(module/x265_module)
endif()

# 构建 ZLIB
if(WITH_ZLIB)
    include(module/zlib_module)
endif()

# 构建 OpenSSL
if(WITH_OPENSSL)
    include(module/openssl_module)
endif()

# ffmpeg 模块
if(WITH_FFMPEG)
    include(module/ffmpeg_module)
endif()

# opencv 模块
if(WITH_OPENCV)
    include(module/opencv_module)
endif()

# mysql-cppconn 模块
if(WITH_MYSQL_CPPCONN)
    include(module/mysql_cppconn_8_0_33_module)
endif()

# fuse3 模块
if(WITH_FUSE3)
    include(module/fuse3_module)
endif()

# ssh 模块
if(WITH_SSH)
    include(module/libssh_module)
endif()

# 构建 ssh2
if(WITH_SSH2)
    include(module/libssh2_module)
endif()

# nlohmann_json 模块
if(WITH_NLOHMANN_JSON)
    include(module/nlohmann_json_module)
endif()

# yaml-cpp 模块
if(WITH_YAML_CPP)
    include(module/yaml_cpp_module)
endif()

# java se 模块
if(WITH_JVN)
    include(module/jvm_module)
endif()

# libpsl 模块
if(WITH_LIBPSL)
    include(module/libpsl_module)
endif()

# curl 模块
if(WITH_CURL)
    include(module/curl_module)
endif()

# drogon 模块

if(WITH_DROGON)
    include(module/drogon_module)
endif()
# jsoncpp 模块

if(WITH_JSONCPP)
    include(module/json_cpp_module)
endif()



# libcpr 模块

if(WITH_LIBCPR)
    include(module/libcpr_module)
endif()
# mingw-w64 模块
if(WITH_MINGW_W64)
    include(module/mingw-w64_module)
endif()
# libjsoncpp-dev
# apt install uuid-dev






